using System;
using System.Collections.Generic;
using System.Text;
using Mpi.Common.Collections;

namespace Xeml.Document
{
    /// <summary>
    /// A dictionary of data mappings between sample ids and external sample data.
    /// </summary>
    public class DataMappings : ObservableIdCollectionBase<SidMapping,int>
    {

        public new  bool Contains(SidMapping s)
        {
            List<SidMapping> temp = base.FindAll(s.SampleId);
            foreach (SidMapping x in temp)
            {
                if (s.Equals(x))
                    return true;
            }
            return false;
        }

        protected override int GetIdentifiere(SidMapping item)
        {
            return item.SampleId;
        }

        protected override void SetOwner(SidMapping item)
        {
            item.Collection = this;
        }

        protected override void RemoveOwner(SidMapping item)
        {
            item.Collection = null;
        }
    }
}
